package districting;

import java.util.Comparator;
import com.vividsolutions.jts.algorithm.*;

public class PBAngleComparator implements Comparator<PollingBooth> {
   Double angle;
   CoordinateAngleComparator coordinateAngleComparator;

   public PBAngleComparator(Double angle) {
      this.angle = angle;
      coordinateAngleComparator = new CoordinateAngleComparator(angle);
   }

   @Override
   public int compare(PollingBooth pb0, PollingBooth pb1) {
      return coordinateAngleComparator.compare(pb0.getPoint()
            .getCoordinate(), pb1.getPoint().getCoordinate());
   }

}
